//
//  UIConstants.h
//  AppFrameWork
//
//  Created by Le Anh Tai on 7/21/13.
//  Copyright (c) 2013 Le Anh Tai. All rights reserved.
//

#define RECT(__x__,__y__,__w__,__h__) CGRectIntegral(CGRectMake(__x__,__y__,__w__,__h__))

#define DEFAULT_ANIMATION_VECLOCITY 1400
#define DEFAULT_SLOWEST_SPEED_TIME 0.4

#define SCREEN_SIZE [UIScreen mainScreen].bounds.size //point

#define NOTIFICATION_CHANGE_THEME @"NOTIFICATION_CHANGE_THEME"
#define NOTIFICATION_CHANGE_LANGUAGE @"NOTIFICATION_CHANGE_LANGUAGE"

//Font
#define FONT_HELVETICANEUE(__x__)           [UIFont fontWithName:@"HelveticaNeue" size:__x__]
#define FONT_HELVETICANEUE_BOLD(__x__)      [UIFont fontWithName:@"HelveticaNeue-Bold" size:__x__]
#define FONT_HELVETICANEUE_ITALIC(__x__)    [UIFont fontWithName:@"HelveticaNeue-Italic" size:__x__]

#define GOLD_TYPE_FONT_SIZE 16

#define TEXT_TITLE_GOLD_PRICE NSLocalizedString(@"GIÁ VÀNG",nil)
#define TEXT_SOURCE_GOLD_PRICE NSLocalizedString(@"(Nguồn SJC)",nil)
#define TEXT_TITLE_EXCHANGE_RATE NSLocalizedString(@"TỶ GIÁ",nil)
#define TEXT_SOURCE_EXCHANGE_RATE NSLocalizedString(@"(Nguồn Vietcombank)",nil)
#define TEXT_CALLOUT_FORMAT_BEFORE NSLocalizedString(@"Lần trước: %@",nil)
#define TEXT_CALLOUT_FORMAT_NOW NSLocalizedString(@"Hiện tại: %@",nil)
#define TEXT_CALLOUT_FORMAT_NON_BEFORE NSLocalizedString(@"Lần trước: Chưa có",nil)
#define TEXT_CHUA_CO @""

//
#define IS_IPHONE (([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone))

#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

#define IS_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_IOS7 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
#define IS_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_IOS8 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")

//
#define Is_Landscape (([[UIApplication sharedApplication] statusBarOrientation]) == UIInterfaceOrientationLandscapeLeft || ([[UIApplication sharedApplication] statusBarOrientation]) == UIInterfaceOrientationLandscapeRight)

//Color
#define COLOR_HEX_ALPHA(rgbValue, alphaValue) [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0f green:((rgbValue & 0xFF00) >> 8)/255.0f blue:(rgbValue & 0xFF)/255.0f alpha:alphaValue*1.0f]

#define COLOR_HEX(rgbValue) COLOR_HEX_ALPHA(rgbValue, 1.0f)

#define COLOR(__r__,__g__,__b__,__a__)    [UIColor colorWithRed:__r__*1.0/255.0 green:__g__*1.0/255.0 blue:__b__*1.0/255.0 alpha:__a__*1.0]

#define COLOR_HIGHLIGHT_TITLE [UIColor greenColor]

//light style
#define COLOR_BACKGROUND_LIGHT COLOR(239,239,244,1)
#define COLOR_BACKGROUND_CELL_LIGHT COLOR(255,255,255,1)
#define COLOR_TEXT_HEADER_LIGHT COLOR(0,0,0,1)//133,133,138,1)
#define COLOR_TEXT_ORANGE_LIGHT COLOR(255, 149, 0, 1);
#define COLOR_BACKGROUND_PULL_TO_REFRESH_LIGHT COLOR(230,230,240,1)

//black style
#define COLOR_BACKGROUND_PULL_TO_REFRESH_DARK COLOR(99,99,99,1)
#define COLOR_TEXT_ORANGE_DARK COLOR(246, 197, 70, 1)
#define COLOR_BACKGROUND_HEADER_DARK COLOR_HEX(0x4C4C4B)
#define COLOR_TEXT_HEADER_DARK COLOR(173,173, 173, 1)
#define COLOR_BLACK_NORMAL COLOR(0,0,0,1)
#define COLOR_LIGHT_BLACK COLOR(79,79,79,1)
#define COLOR_DARK_ORANGE COLOR(202,141,19,1)
#define COLOR_WHITE_NORMAL COLOR(240,240,240,1)
#define COLOR_LIGHT_GRAY COLOR(231,231,231,1)
#define COLOR_TEXT_LIGHT_GRAY COLOR(158,158,158,1)
#define COLOR_BLUE_IOS7 COLOR(0,105,245,1)
#define COLOR_RED_NORMAL COLOR(229,0,0,1)
#define COLOR_GREEN_NORMAL COLOR(1,212,5,1)

